// Copyright (c) MatrixFramework. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using PhotoGalleryService.Photos;

namespace PhotoGalleryService.Application.Contracts.Photos;

/// <summary>
/// 照片应用服务接口
/// </summary>
public interface IPhotoAppService : ICrudAppService<
    PhotoDto,
    Guid,
    PagedAndSortedResultRequestDto,
    CreateUpdatePhotoDto>
{
    /// <summary>
    /// 上传照片
    /// </summary>
    /// <param name="input">上传输入参数</param>
    /// <returns>上传的照片信息</returns>
    Task<PhotoDto> UploadAsync(PhotoUploadInput input);

    /// <summary>
    /// 批量上传照片
    /// </summary>
    /// <param name="inputs">上传输入参数列表</param>
    /// <returns>照片信息列表</returns>
    Task<List<PhotoDto>> BatchUploadAsync(List<PhotoUploadInput> inputs);

    /// <summary>
    /// 下载照片
    /// </summary>
    /// <param name="id">照片ID</param>
    /// <returns>文件流信息</returns>
    Task<PhotoDownloadDto> DownloadAsync(Guid id);

    /// <summary>
    /// 获取照片内容
    /// </summary>
    /// <param name="id">照片ID</param>
    /// <param name="size">图片尺寸（original, medium, thumbnail）</param>
    /// <returns>文件流</returns>
    Task<byte[]> GetContentAsync(Guid id, string size = "original");

    /// <summary>
    /// 根据哈希查找照片
    /// </summary>
    /// <param name="fileHash">文件哈希</param>
    /// <returns>照片信息</returns>
    Task<PhotoDto?> FindByHashAsync(string fileHash);

    /// <summary>
    /// 搜索照片
    /// </summary>
    /// <param name="input">搜索条件</param>
    /// <returns>分页结果</returns>
    Task<PagedResultDto<PhotoDto>> SearchAsync(PhotoSearchInput input);

    /// <summary>
    /// 获取我的照片
    /// </summary>
    /// <param name="input">分页请求</param>
    /// <returns>分页结果</returns>
    Task<PagedResultDto<PhotoDto>> GetMyPhotosAsync(PagedAndSortedResultRequestDto input);

    /// <summary>
    /// 获取公开照片
    /// </summary>
    /// <param name="input">分页请求</param>
    /// <returns>分页结果</returns>
    Task<PagedResultDto<PhotoDto>> GetPublicPhotosAsync(PagedAndSortedResultRequestDto input);
}